package service;



import dao.Tipdao;
import pojo.Tip;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

/**
 * 遍历订单数据
 */
public class TipService {

    Tipdao tipdao = new Tipdao();

    public TipService(){

    }
    public List<Tip> getTip(String sql,String userId) throws SQLException {
        List<Tip> mytips = null;
        mytips = tipdao.list(sql,userId);
        return mytips;
    }

    public List<Tip> getTip(String sql) throws SQLException {
        List<Tip> mytips = null;
        mytips = tipdao.list(sql);
        return mytips;
    }

    public String addtip(String sql,String uid, String seat,String money, String details) throws SQLException {
        return tipdao.addtip(sql,uid,seat,money,details);
    }

    public String updattip(String sql, String orderNum, String status) throws SQLException {
        return tipdao.updattip(sql,orderNum,status);
    }

    public String deletetip(String sql, String orderNum) throws SQLException {
        return tipdao.deletetip(sql,orderNum);
    }

//    public static void main(String[] args) {
//        GetTipsService s = new GetTipsService();
//        s.getTip("1");
//        System.out.println(s.getTip("1").size());
//        for (int i = 0; i < s.getTip("1").size(); i++) {
//            System.out.println("单号："+s.getTip("1").get(i).getOrderNum());
//            System.out.println(s.getTip("1").get(i).getOrderTime());
//
//        }
//    }
}
